package com.cn.xiaonuo.tcrfinance.tcrgnete.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.tcrfinance.tcrgnete.param.SettlementPageParam;
import com.cn.xiaonuo.tcrfinance.tcrgnete.service.ShopSettlementService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @BelongsProject: slb-reports-java
 * @Author: likui
 * @CreateTime: 2022-11-10  09:14
 * @Description: 分账处理记录
 */
@RestController
public class ShopSettlementController {

    @Autowired
    private ShopSettlementService shopSettlementService;

    @ApiOperation(value = "现金分账处理记录", notes = "现金分账处理记录")
    @PostMapping(value = "/api/shopSettlement/pageShopSettlement")
    public BusinessMessage pageShopSettlement(@RequestBody SettlementPageParam param){
        return shopSettlementService.pageShopSettlement(param);
    }

    /**
     *现金分账处理记录导出功能
     * @param response
     * @param param
     */
    @ApiOperation(value = "现金分账处理记录导出功能", notes = "现金分账处理记录导出功能")
    @GetMapping(value = "/api/shopSettlement/shopSettlementExcel")
    public void shopSettlementExcel(HttpServletResponse response, SettlementPageParam param) {
        shopSettlementService.shopSettlementExcel(response,param);
    }


    @ApiOperation(value = "商户钱包关联进件编号", notes = "商户钱包关联进件编号")
    @PostMapping(value = "/api/common/shopSettlement/shopIncomingParts")
    public BusinessMessage shopIncomingParts(HttpServletRequest request) throws IOException {
       return shopSettlementService.shopIncomingParts(request);
    }

    /**
     *分账入账记录导出功能
     * @param response
     * @param param
     */
    @ApiOperation(value = "分账入账记录导出功能", notes = "分账入账记录导出功能")
    @GetMapping(value = "/api/shopSettlement/subLedgerEntryRecordExcel")
    public void subLedgerEntryRecordExcel(HttpServletResponse response, SettlementPageParam param) {
        shopSettlementService.subLedgerEntryRecordExcel(response,param);
    }
}
